const path = require('path');

// 先定义存储路径，避免循环引用
const STORAGE_PATH = path.join(__dirname, '../../shared-files');

module.exports = {
  // 服务器配置
  server: {
    port: process.env.PORT || 3000,
    host: '127.0.0.1' // 仅允许本地访问
  },
  
  // 文件存储配置
  storage: {
    path: STORAGE_PATH,
    maxFileSize: 100 * 1024 * 1024, // 100MB
    allowedMimeTypes: [] // 空数组表示允许所有类型
  },
  
  // CORS配置
  cors: {
    allowedOrigins: '*', // 允许所有来源
    credentials: true,
    allowMethods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
    allowHeaders: ['Content-Type', 'Authorization', 'Accept', 'X-Requested-With']
  }
}; 